package org.mypofolio.model.update;

import java.util.ArrayList;
import java.util.List;

import org.mypofolio.model.CurrencyTableModel;

public class UpdateManager {
	
	private List<UpdateStockThread> list = new ArrayList<UpdateStockThread>();
	private CurrencyTableModel cm;
	
	public UpdateManager(CurrencyTableModel cm){
		this.cm=cm;
	}
	
	
	public void addToQueue(int row,int col,String stockId){
		list.add(new UpdateStockThread(row, col, stockId, cm));
	}


	public void start() {
		for (int i = 0; i < list.size(); i++) {
			list.get(i).execute();
		}
		
	}

}
